//
//  NoticeMsgCell.m
//  阿帕
//
//  Created by mac on 2020/1/2.
//  Copyright © 2020 GCY. All rights reserved.
//

#import "NoticeMsgCell.h"
@interface NoticeMsgCell ()
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UIView *tLine;
@property (weak, nonatomic) IBOutlet UILabel *tipTextLabel;
@property (weak, nonatomic) IBOutlet UIView *bLine;
@property (weak, nonatomic) IBOutlet UILabel *readFlag;
//@property (nonatomic, strong) UIView *redDot;

@end

@implementation NoticeMsgCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    _typeLabel.textColor = Dark_TextColor;
    _dateLabel.textColor = Light_TextColor;
    _contentLabel.textColor = Dark_TextColor;
    _contentLabel.adjustsFontSizeToFitWidth = YES;
    _tLine.backgroundColor = BackgroundColor;
    _bLine.backgroundColor = BackgroundColor;
    _tipTextLabel.textColor = Dark_TextColor;
}

- (void)setModel:(NoticeModel *)model {
    
    _model = model;
    
    if ([model.extras.isSystem isEqualToString:@"1"]) {
        _typeLabel.text = @"系统消息";
    } else {
        _typeLabel.text = @"新订单通知";
    }
    if ([model.havaRead isEqualToString:@"0"]) {
        _readFlag.text = @"未读";
        _readFlag.textColor = [UIColor redColor];
    } else {
        _readFlag.text = @"已读";
        _readFlag.textColor = Dark_TextColor;
    }
    
    _dateLabel.text = model.extras.pushTime;
    _contentLabel.text = model.alert;
}

- (void)setDataDic:(NSDictionary *)dataDic {
    _dataDic = dataDic;
    
    if ([dataDic[@"isSystem"] integerValue] == 1) {
        _typeLabel.text = @"系统消息";
    } else {
        _typeLabel.text = @"新订单通知";
    }
    
    _dateLabel.text = dataDic[@"pushTime"];
    _contentLabel.text = dataDic[@"content"];
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
